fix: CLI always reported version 0.1.0#10
Merged
sweetmantech merged 2 commits intomainfrom Feb 25, 2026
Merged
Conversation
The version was hardcoded as "0.1.0" in bin.ts, so every published version reported itself as 0.1.0 regardless of the actual version. Also reorders the publish workflow to bump version before building, so the built artifact includes the correct version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe pull request reorders build and test steps in CI workflows, adds CLI version validation testing, and changes the CLI to dynamically read version from package.json rather than using a hardcoded value. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The version test requires dist/bin.cjs to exist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
recoup --versionwas hardcoded to0.1.0inbin.ts, so every published version (0.1.1 through 0.1.7) reported itself as 0.1.0package.jsonat runtime using__dirname(works in CJS bundle)pnpm build, so the built artifact includes the correct versionRoot cause
bin.tshad.version("0.1.0")hardcodedpnpm buildbeforenpm version patch, so even if the version were read at build time, it would be staleTest plan
expected '0.1.0' to be '0.1.7'node dist/bin.cjs --versionoutputs0.1.7🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Tests
Chores